<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SARibbon: C:/src/Qt/SARibbon/src/SARibbonBar/SAFramelessHelper.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="SA-logo.png"/></td>
  <td id="projectalign">
   <div id="projectname">SARibbon<span id="projectnumber">&#160;2.4.2</span>
   </div>
   <div id="projectbrief">SARibbon wiki</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_c_1_2src_2_qt_2_s_a_ribbon_2src_2_s_a_ribbon_bar_2_s_a_frameless_helper_8h-example.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">C:/src/Qt/SARibbon/src/SARibbonBar/SAFramelessHelper.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="_a0" name="_a0"></a><a class="code hl_class" href="class_s_a_frameless_helper.html">SAFramelessHelper</a>* helper = <span class="keyword">new</span> <a class="code hl_class" href="class_s_a_frameless_helper.html">SAFramelessHelper</a>(<span class="keyword">this</span>);</div>
<div class="line">helper-&gt;<a id="a1" name="a1"></a><a class="code hl_function" href="class_s_a_frameless_helper.html#ad8de5a36386b803ca638afb1ea5c6230">activateOn</a>(myWidget);</div>
<div class="line">helper-&gt;<a id="a2" name="a2"></a>setWidgetMovable(<span class="keyword">true</span>);</div>
<div class="line">helper-&gt;<a id="a3" name="a3"></a>setWidgetResizable(<span class="keyword">true</span>);</div>
<div class="ttc" id="aclass_s_a_frameless_helper_html"><div class="ttname"><a href="class_s_a_frameless_helper.html">SAFramelessHelper</a></div><div class="ttdoc">该类用于帮助实现无边框窗体的移动和缩放功能。</div><div class="ttdef"><b>Definition</b> SAFramelessHelper.h:25</div></div>
<div class="ttc" id="aclass_s_a_frameless_helper_html_ad8de5a36386b803ca638afb1ea5c6230"><div class="ttname"><a href="class_s_a_frameless_helper.html#ad8de5a36386b803ca638afb1ea5c6230">SAFramelessHelper::activateOn</a></div><div class="ttdeci">void activateOn(QWidget *topLevelWidget)</div><div class="ttdoc">激活指定的顶级窗体 使指定的顶级窗体能够使用 SAFramelessHelper 提供的无边框移动和缩放功能。</div><div class="ttdef"><b>Definition</b> SAFramelessHelper.cpp:570</div></div>
</div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#ifndef SAFRAMELESSHELPER_H</span></div>
<div class="line"><span class="preprocessor">#define SAFRAMELESSHELPER_H</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;SARibbonGlobal.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &lt;QObject&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>QWidget;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">class </span>SA_RIBBON_EXPORT <a class="code hl_class" href="class_s_a_frameless_helper.html">SAFramelessHelper</a> : <span class="keyword">public</span> QObject</div>
<div class="line">{</div>
<div class="line">    Q_OBJECT</div>
<div class="line">    SA_RIBBON_DECLARE_PRIVATE(<a class="code hl_class" href="class_s_a_frameless_helper.html">SAFramelessHelper</a>)</div>
<div class="line">    <span class="keyword">friend</span> <span class="keyword">class </span><a id="_a4" name="_a4"></a><a class="code hl_class" href="class_s_a_private_frameless_widget_data.html">SAPrivateFramelessWidgetData</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">    <span class="keyword">explicit</span> <a class="code hl_class" href="class_s_a_frameless_helper.html">SAFramelessHelper</a>(QObject* parent);</div>
<div class="line">    <a class="code hl_class" href="class_s_a_frameless_helper.html">~SAFramelessHelper</a>();</div>
<div class="line">    <span class="comment">// 激活窗体</span></div>
<div class="line">    <span class="keywordtype">void</span> activateOn(QWidget* topLevelWidget);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 移除窗体</span></div>
<div class="line">    <span class="keywordtype">void</span> removeFrom(QWidget* topLevelWidget);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置窗体移动</span></div>
<div class="line">    <span class="keywordtype">void</span> setWidgetMovable(<span class="keywordtype">bool</span> movable);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置窗体缩放</span></div>
<div class="line">    <span class="keywordtype">void</span> setWidgetResizable(<span class="keywordtype">bool</span> resizable);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置橡皮筋移动</span></div>
<div class="line">    <span class="keywordtype">void</span> setRubberBandOnMove(<span class="keywordtype">bool</span> movable);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置橡皮筋缩放</span></div>
<div class="line">    <span class="keywordtype">void</span> setRubberBandOnResize(<span class="keywordtype">bool</span> resizable);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置边框的宽度</span></div>
<div class="line">    <span class="keywordtype">void</span> setBorderWidth(<span class="keywordtype">int</span> width);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// 设置标题栏高度</span></div>
<div class="line">    <span class="keywordtype">void</span> setTitleHeight(<span class="keywordtype">int</span> height);</div>
<div class="line">    <span class="keywordtype">bool</span> widgetResizable();</div>
<div class="line">    <span class="keywordtype">bool</span> widgetMovable();</div>
<div class="line">    <span class="keywordtype">bool</span> rubberBandOnMove();</div>
<div class="line">    <span class="keywordtype">bool</span> rubberBandOnResisze();</div>
<div class="line">    uint borderWidth();</div>
<div class="line">    uint titleHeight();</div>
<div class="line">    <span class="comment">// 获取当前屏幕的 DPI 缩放因子</span></div>
<div class="line">    <span class="keyword">static</span> qreal getScreenDpiScale(<span class="keyword">const</span> QWidget* widget);</div>
<div class="line"> </div>
<div class="line"><span class="keyword">protected</span>:</div>
<div class="line">    <span class="comment">// 事件过滤，进行移动、缩放等</span></div>
<div class="line">    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> eventFilter(QObject* obj, QEvent* event);</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif  </span><span class="comment">// FRAMELESSHELPER_H</span></div>
<div class="ttc" id="aclass_s_a_private_frameless_widget_data_html"><div class="ttname"><a href="class_s_a_private_frameless_widget_data.html">SAPrivateFramelessWidgetData</a></div><div class="ttdoc">更新鼠标样式、移动窗体、缩放窗体。</div><div class="ttdef"><b>Definition</b> SAFramelessHelper.cpp:131</div></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
